3.7.41 \(\int (d \sec (e+f x))^m (a+b \tan (e+f x))^2 \, dx\) [641]

Optimal. Leaf size=147 \[ \frac {a b (2+m) (d \sec (e+f x))^m}{f m (1+m)}+\frac {d \left (b^2-a^2 (1+m)\right ) \, _2F_1\left (\frac {1}{2},\frac {1-m}{2};\frac {3-m}{2};\cos ^2(e+f x)\right ) (d \sec (e+f x))^{-1+m} \sin (e+f x)}{f (1-m) (1+m) \sqrt {\sin ^2(e+f x)}}+\frac {b (d \sec (e+f x))^m (a+b \tan (e+f x))}{f (1+m)} \]

[Out]

a*b*(2+m)*(d*sec(f*x+e))^m/f/m/(1+m)+d*(b^2-a^2*(1+m))*hypergeom([1/2, 1/2-1/2*m],[3/2-1/2*m],cos(f*x+e)^2)*(d
*sec(f*x+e))^(-1+m)*sin(f*x+e)/f/(-m^2+1)/(sin(f*x+e)^2)^(1/2)+b*(d*sec(f*x+e))^m*(a+b*tan(f*x+e))/f/(1+m)

________________________________________________________________________________________

Rubi [A]
time = 0.12, antiderivative size = 147, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {3589, 3567, 3857, 2722} \begin {gather*} \frac {d \left (b^2-a^2 (m+1)\right ) \sin (e+f x) (d \sec (e+f x))^{m-1} \, _2F_1\left (\frac {1}{2},\frac {1-m}{2};\frac {3-m}{2};\cos ^2(e+f x)\right )}{f (1-m) (m+1) \sqrt {\sin ^2(e+f x)}}+\frac {a b (m+2) (d \sec (e+f x))^m}{f m (m+1)}+\frac {b (a+b \tan (e+f x)) (d \sec (e+f x))^m}{f (m+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^2,x]

[Out]

(a*b*(2 + m)*(d*Sec[e + f*x])^m)/(f*m*(1 + m)) + (d*(b^2 - a^2*(1 + m))*Hypergeometric2F1[1/2, (1 - m)/2, (3 -
 m)/2, Cos[e + f*x]^2]*(d*Sec[e + f*x])^(-1 + m)*Sin[e + f*x])/(f*(1 - m)*(1 + m)*Sqrt[Sin[e + f*x]^2]) + (b*(
d*Sec[e + f*x])^m*(a + b*Tan[e + f*x]))/(f*(1 + m))

Rule 2722

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[Cos[c + d*x]*((b*Sin[c + d*x])^(n + 1)/(b*d*(n + 1
)*Sqrt[Cos[c + d*x]^2]))*Hypergeometric2F1[1/2, (n + 1)/2, (n + 3)/2, Sin[c + d*x]^2], x] /; FreeQ[{b, c, d, n
}, x] &&  !IntegerQ[2*n]

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3589

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> Simp[b*(d*Sec
[e + f*x])^m*((a + b*Tan[e + f*x])/(f*(m + 1))), x] + Dist[1/(m + 1), Int[(d*Sec[e + f*x])^m*(a^2*(m + 1) - b^
2 + a*b*(m + 2)*Tan[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && NeQ[a^2 + b^2, 0] && NeQ[m, -1]

Rule 3857

Int[(csc[(c_.) + (d_.)*(x_)]*(b_.))^(n_), x_Symbol] :> Simp[(b*Csc[c + d*x])^(n - 1)*((Sin[c + d*x]/b)^(n - 1)
*Int[1/(Sin[c + d*x]/b)^n, x]), x] /; FreeQ[{b, c, d, n}, x] &&  !IntegerQ[n]

Rubi steps

\begin {align*} \int (d \sec (e+f x))^m (a+b \tan (e+f x))^2 \, dx &=\frac {b (d \sec (e+f x))^m (a+b \tan (e+f x))}{f (1+m)}+\frac {\int (d \sec (e+f x))^m \left (-b^2+a^2 (1+m)+a b (2+m) \tan (e+f x)\right ) \, dx}{1+m}\\ &=\frac {a b (2+m) (d \sec (e+f x))^m}{f m (1+m)}+\frac {b (d \sec (e+f x))^m (a+b \tan (e+f x))}{f (1+m)}+\left (a^2-\frac {b^2}{1+m}\right ) \int (d \sec (e+f x))^m \, dx\\ &=\frac {a b (2+m) (d \sec (e+f x))^m}{f m (1+m)}+\frac {b (d \sec (e+f x))^m (a+b \tan (e+f x))}{f (1+m)}+\left (\left (a^2-\frac {b^2}{1+m}\right ) \left (\frac {\cos (e+f x)}{d}\right )^m (d \sec (e+f x))^m\right ) \int \left (\frac {\cos (e+f x)}{d}\right )^{-m} \, dx\\ &=\frac {a b (2+m) (d \sec (e+f x))^m}{f m (1+m)}-\frac {\left (a^2-\frac {b^2}{1+m}\right ) \cos (e+f x) \, _2F_1\left (\frac {1}{2},\frac {1-m}{2};\frac {3-m}{2};\cos ^2(e+f x)\right ) (d \sec (e+f x))^m \sin (e+f x)}{f (1-m) \sqrt {\sin ^2(e+f x)}}+\frac {b (d \sec (e+f x))^m (a+b \tan (e+f x))}{f (1+m)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 6 vs. order 5 in optimal.
time = 26.49, size = 11095, normalized size = 75.48 \begin {gather*} \text {Result too large to show} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[(d*Sec[e + f*x])^m*(a + b*Tan[e + f*x])^2,x]

[Out]

Result too large to show

________________________________________________________________________________________

Maple [F]
time = 0.28, size = 0, normalized size = 0.00 \[\int \left (d \sec \left (f x +e \right )\right )^{m} \left (a +b \tan \left (f x +e \right )\right )^{2}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d*sec(f*x+e))^m*(a+b*tan(f*x+e))^2,x)

[Out]

int((d*sec(f*x+e))^m*(a+b*tan(f*x+e))^2,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e))^2,x, algorithm="maxima")

[Out]

integrate((b*tan(f*x + e) + a)^2*(d*sec(f*x + e))^m, x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e))^2,x, algorithm="fricas")

[Out]

integral((b^2*tan(f*x + e)^2 + 2*a*b*tan(f*x + e) + a^2)*(d*sec(f*x + e))^m, x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (d \sec {\left (e + f x \right )}\right )^{m} \left (a + b \tan {\left (e + f x \right )}\right )^{2}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))**m*(a+b*tan(f*x+e))**2,x)

[Out]

Integral((d*sec(e + f*x))**m*(a + b*tan(e + f*x))**2, x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((d*sec(f*x+e))^m*(a+b*tan(f*x+e))^2,x, algorithm="giac")

[Out]

integrate((b*tan(f*x + e) + a)^2*(d*sec(f*x + e))^m, x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\left (\frac {d}{\cos \left (e+f\,x\right )}\right )}^m\,{\left (a+b\,\mathrm {tan}\left (e+f\,x\right )\right )}^2 \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((d/cos(e + f*x))^m*(a + b*tan(e + f*x))^2,x)

[Out]

int((d/cos(e + f*x))^m*(a + b*tan(e + f*x))^2, x)

________________________________________________________________________________________